home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Applications / Painted Black 0.91 / src / QuickQD.h < prev   
Encoding:
C/C++ Source or Header  |  1995-12-27  |  1.4 KB  |  73 lines  |  [TEXT/CWIE]

  1. /*
  2.  
  3. QuickQD.h
  4.  
  5. Quick QuickDraw Routines for accelerated graphics
  6.  
  7. Written by Hubert Figuière
  8. ©Copyright 1995, Hubert Figuière, All right reserved.
  9.  
  10. April 26th, 1995
  11.  
  12.  
  13. Modified :
  14. -6Sept95
  15.  
  16. Public Distrbution 1.0
  17.  
  18. */
  19.  
  20. #include <QuickDraw.h>
  21.  
  22.  
  23. /**********************************************************************/
  24. /* these are macro for inline inclusion... very small size and speedy */
  25. /*                                                                    */
  26. /*                                                                    */
  27.  
  28. /* Math macros */
  29.  
  30. /* 5/07/95
  31.     absolute value
  32.     WARNING : do not put Function as argument...
  33. */
  34. #define QuickAbs(x)    ((x)<0 ? -(x))
  35.  
  36. /* 4/26/95
  37.     compare 2 Points... very speedy
  38. */
  39. #define    QuickEqualPt(pt1, pt2)    (*(long*)&pt1 == *(long*)&pt2)
  40.  
  41. /* 4/26/95
  42.     from a Point, make a Point...
  43. */
  44. #define QuickCopyPt(dst, src)    (*(long*)&dst = *(long*)&src)
  45.  
  46. /* 4/26/95
  47.     from 2 shorts make a Point...
  48. */
  49. #define    QuickSetPt(pt1, ph, pv)        pt1.v = pv; pt1.h = ph;
  50.  
  51. /*
  52.     from a long make a Point
  53. */
  54. #define QuickMakePt(x)        (*(Point *)&x)    
  55.  
  56.  
  57. /***
  58.     Word operations
  59.     6Sept95
  60. ***/
  61. /*
  62.     Retrieve the Highest word from a long word
  63. */
  64. #define QuickHiWord(x)    ((unsigned long)(x) >> 16)
  65.  
  66. /*
  67.     Retrieve the Lowest word from a long word
  68. */
  69. #define QuickLoWord(x)    ((unsigned long)(x) & 0xFFFF)
  70.  
  71. /*                                                                    */
  72. /**********************************************************************/
  73.